<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>管理员登录-内容管理系统</title>

    <link href="/Public/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="/Public/assets/css/common.css">
    
</head>
<body>

<nav class="navbar navbar-default navbar-fixed-top col-md-10">
    <div class="container-fluid nav_bg">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                    data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="<?php echo U('File/home_page');?>">首页</a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
                <ul class="nav navbar-nav">
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">系统设置<span class="caret"></span></a>
                        <ul class="dropdown-menu" role="menu">
                            <li><a href="<?php echo U('System/info');?>">系统信息</a></li>
                            <li><a href="<?php echo U('System/change_password');?>">修改密码</a></li>
                            <li><a href="#">清除缓存</a></li>
                        </ul>
                    </li>
                    <li >
                        <a href="<?php echo U('Link/index');?>"  >友情链接</a>

                    </li>
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">内容管理<span class="caret"></span></a>
                        <ul class="dropdown-menu" role="menu">
                            <li><a href="">文章列表</a></li>
                            <li><a href="<?php echo U('Category/index');?>">栏目管理</a></li>
                        </ul>
                    </li>
                </ul>
            </ul>


            <ul class="nav navbar-nav navbar-right">
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                       aria-expanded="false">尊敬的 <?php echo ($user["email"]); ?><span class="caret"></span></a>
                    <ul class="dropdown-menu">
                        <li><a href="#">Action</a></li>

                        <li role="separator" class="divider"></li>
                        <li><a href="<?php echo U('User/logout');?>">安全退出</a></li>
                    </ul>
                </li>
            </ul>
        </div><!-- /.navbar-collapse -->
    </div><!-- /.container-fluid -->
</nav>

<div class="container-fluid">
    
    <div class="row">
        <div class="col-md-12">

            <div class="row">
                <div class="col-md-8">
                    <div class="page-header">
                        <h1>栏目管理</h1>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-md-10">
                    <div class="panel panel-default">
                        <div class="panel-heading">栏目管理</div>
                        <div class="panel-body">
                            <table class="table table-bordered">
                                <thead>
                                <tr>
                                <tr>
                                    <th>排序</th>
                                    <th>名称</th>
                                    <th>栏目文章</th>
                                    <th>操作</th>
                                </tr>
                                </tr>
                                </thead>
                                <tbody>
                                <?php if(is_array($categories)): $i = 0; $__LIST__ = $categories;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$c): $mod = ($i % 2 );++$i;?><tr>
                                        <td><?php echo ($c["id"]); ?></td>
                                        <td><?php echo ($c["name"]); ?></td>
                                        <td>aa</td>
                                        <td>
                                            <a href="" data-toggle="modal" data-target="#edit_categoryModal"
                                               class="edit"><span
                                                    class="glyphicon glyphicon-pencil"></span></a>
                                            <a href="<?php echo U('destory',array('id'=>$c['id']));?>"> <span
                                                    class="glyphicon glyphicon-trash"></span></a>
                                        </td>
                                    </tr><?php endforeach; endif; else: echo "" ;endif; ?>
                                </tbody>
                            </table>

                        </div>
                    </div>
                </div>
                <div class="col-md-2">
                    <div class="list-group">
                        <a href="javascript: void 0;" class="list-group-item list-group-item-info sort_category"
                           data-toggle="modal" data-target="#add_categoryModal">
                            <span class="glyphicon glyphicon-plus" aria-hidden="true"></span> 新增 (add)
                        </a>
                        <a href="javascript: void 0;" class="list-group-item list-group-item-info sort_category">
                            <span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> 排序 (sort)
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="modal fade" id="add_categoryModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
         aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span
                            aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                    <h4 class="modal-title" id="myModalLabel">新增栏目管理</h4>
                </div>
                <div class="modal-body">
                    <ul class="nav nav-tabs" role="tablist">
                        <li role="presentation" class="active"><a href="#home" role="tab" data-toggle="tab">添加栏目</a>
                        </li>
                        <li role="presentation"><a href="#profile" role="tab" data-toggle="tab">栏目内容</a></li>
                    </ul>
                    <form class="form" role="form" method="post" action="<?php echo U('store');?>">
                        <div class="tab-content">

                            <div role="tabpanel" class="tab-pane active" id="home">

                                <div class="form-group">
                                    <label for="fname" class="col-sm-2 control-label">父栏目</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" id="fname" placeholder="顶级栏目" disabled>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="name" class="col-sm-2 control-label">名称</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" name="name" id="name"
                                               placeholder="请输入名称">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="pinyin" class="col-sm-2 control-label">pinyin</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" name="pinyin" id="pinyin"
                                               placeholder="请输入拼音">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="is_show" class="col-sm-2 control-label">是否显示</label>
                                    <div class="col-sm-10">
                                        <div class="radio">
                                            <label>
                                                <input type="radio" name="is_show" id="is_show"
                                                       value="1"
                                                       checked>
                                                是
                                            </label>
                                        </div>
                                        <div class="radio">
                                            <label>
                                                <input type="radio" name="is_show" id="is_show2"
                                                       value="2">
                                                否
                                            </label>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="type" class="col-sm-2 control-label">类型</label>
                                    <div class="col-sm-10">
                                        <div class="radio">
                                            <label class="radio-inline">
                                                <input type="radio" name="type" id="type" value="1"> 封面
                                            </label>
                                            <label class="radio-inline">
                                                <input type="radio" name="type" id="inlineRadio2" value="2"> 列表
                                            </label>
                                            <label class="radio-inline">
                                                <input type="radio" name="type" id="inlineRadio3" value="3"> URL跳转
                                            </label>
                                        </div>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label for="url" class="col-sm-2 control-label">url跳转地址</label>
                                    <div class="col-sm-10">
                                        <input type="text" name="url" class="form-control" id="url"
                                               placeholder="请输入地址">
                                    </div>
                                </div>
                            </div>
                            <div role="tabpanel" class="tab-pane" id="profile">
                                <textarea name="content" class="form-control" rows="13"></textarea>
                            </div>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default" data-dismiss="modal">返回</button>
                            <button type="submit" class="btn btn-primary">保存</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

    <div class="modal fade" id="edit_categoryModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
         aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span
                            aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                    <h4 class="modal-title" id="editModalLabel">修改栏目管理</h4>
                </div>
                <div class="modal-body">
                    <ul class="nav nav-tabs" role="tablist">
                        <li role="presentation" class="active"><a href="#home1" role="tab" data-toggle="tab">添加栏目</a>
                        </li>
                        <li role="presentation"><a href="#profile1" role="tab" data-toggle="tab">栏目内容</a></li>
                    </ul>
                    <form class="form" role="form" method="post" action="<?php echo U('update');?>">
                        <div class="tab-content">

                            <div role="tabpanel" class="tab-pane active" id="home1">

                                <div class="form-group">
                                    <label for="fname1" class="col-sm-2 control-label">父栏目</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" id="fname1" placeholder="顶级栏目" disabled>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="name1" class="col-sm-2 control-label">名称</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" name="name" id="name1"
                                               placeholder="请输入名称">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="pinyin1" class="col-sm-2 control-label">pinyin</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" name="pinyin" id="pinyin1"
                                               placeholder="请输入拼音">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="type1" class="col-sm-2 control-label">类型</label>
                                    <div class="col-sm-10">
                                        <div class="radio">
                                            <label>
                                                <input type="radio" name="type" id="type1"
                                                       value="1"
                                                       checked>
                                                封面
                                            </label>
                                        </div>
                                        <div class="radio">
                                            <label>
                                                <input type="radio" name="type"
                                                       value="2">
                                                列表
                                            </label>
                                        </div>
                                        <div class="radio">
                                            <label>
                                                <input type="radio" name="type"
                                                       value="3">
                                                URL跳转
                                            </label>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="is_show1" class="col-sm-2 control-label">是否显示</label>
                                    <div class="col-sm-10">
                                        <div class="radio">
                                            <label>
                                                <input type="radio" name="is_show" id="is_show1"
                                                       value="1"
                                                       checked>
                                                是
                                            </label>
                                        </div>
                                        <div class="radio">
                                            <label>
                                                <input type="radio" name="is_show"
                                                       value="2">
                                                否
                                            </label>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="url1" class="col-sm-2 control-label">url跳转地址</label>
                                    <div class="col-sm-10">
                                        <input type="text" name="url" class="form-control" id="url1"
                                               placeholder="请输入地址">
                                    </div>
                                </div>
                            </div>
                            <div role="tabpanel" class="tab-pane" id="profile1">
                                <textarea name="content" class="form-control" rows="13"></textarea>
                            </div>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default" data-dismiss="modal">返回</button>
                            <button type="submit" class="btn btn-primary">保存</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>


</div>

<script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
<script src="/Public/bootstrap/js/bootstrap.min.js"></script>


</body>
</html>